//
//  NewViewController.m
//  2048
//
//  Created by 胡先剑 on 16/3/20.
//  Copyright © 2016年 胡先剑. All rights reserved.
//

#import "NewViewController.h"

@interface NewViewController ()

/** 滑动视图 */
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;

/** 开始按钮 */
@property (weak, nonatomic) IBOutlet UIButton *startButton;

/** 分页控件 */
@property (weak, nonatomic) IBOutlet UIPageControl *pageControl;

@end

@implementation NewViewController

#pragma mark - 视图加载
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    /* 设置按钮圆角 */
    self.startButton.layer.cornerRadius = 5;
    
    /* 设置滑动视图的显示尺寸 */
    self.scrollView.contentSize = CGSizeMake(414*3, 0);
}

#pragma mark - 滑动视图滑动时触发的方法
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    /* 设置分页控件的选中点 */
    self.pageControl.currentPage = scrollView.contentOffset.x/414;
    
}

@end
